# -*- coding: utf-8 -*-
# @Time: 2021/8/16 17:39
# @File: problem-94.py
# @DESC: https://leetcode-cn.com/problems/binary-tree-inorder-traversal/
# 二叉树中序遍历 左中右
from typing import List
class TreeNode:
    def __init__(self, val=0, left=None, right=None):
        self.val = val
        self.left = left
        self.right = right
class Solution:
    def inorderTraversal(self, root: TreeNode) -> List[int]:
        if not root:
            return []
        return self.inorderTraversal(root.left) + [root.val] + self.inorderTraversal(root.right)


treeNode = TreeNode()
treeNode.left = TreeNode(1)
treeNode.left.left = TreeNode(11)
treeNode.left.right = TreeNode(12)
treeNode.right = TreeNode(2)


solution = Solution()

result = solution.inorderTraversal(treeNode)

print()